package com.imau.common;

/*
 * 返回提示消息枚举
 * @description:
 * @author: fenlo
 * @date: 2022/11/28 20:50
 * @return:
 **/
public enum ResultCodeEnum {

    /**
     * 全局异常错误
     */
    GLOBAL_ERROR(500, "服务器异常"),

    /**
     * 成功:200
     */
    SUCCESS(200, "成功"),
    USER_LOGIN_SUCCESS(200, "登录成功"),
    USER_LOGOUT_SUCCESS(200, "退出登录成功"),
    USER_UPDATE_SUCCESS(200, "修改成功"),
    DELETE_SUCCESS(200, "删除成功"),

    /**
     * 参数错误：1001-1999
     */
    PARAM_IS_INVALID(1001, "参数无效"),
    PARAM_IS_NULL(1002, "参数为空"),
    PARAM_TYPE_BIND_ERROR(1003, "参数类型错误"),
    PARAM_NOT_COMPLETE(1004, "参数缺失"),

    /**
     * 用户错误：2001-2999
     */
    USER_NOT_LOGIN_IN(2001, "用户未登录，访问的路径需要验证，请登录"),
    USER_LOGIN_PASSWORD_ERROR(2002, "密码错误"),
    USER_ACCOUNT_FORBIDDEN(2003, "账号不是管理员账号"),
    USER_NOT_EXIST(2004, "用户不存在"),
    USER_HAS_EXISTED(2005, "用户已存在");


    private final Integer code;
    private final String message;

    ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}

